<template>
  <!-- <h2>随访管理</h2> -->
  <zsearch v-loading="loading">
      <template #title>
          <span>随访管理</span>
      </template>
      <template #date>
        <el-date-picker
            class="date-1"
            type="date"
            v-model="date"
            value-format="YYYY-MM-DD HH:mm:ss"
            placeholder="选择日期">
        </el-date-picker>
      </template>
      <template #select>
        <el-input class="input-1" v-model="name" placeholder="请输入内容"></el-input>
      </template>
      <template #btns>
        <el-button class="btn-1" @click="hanledSearch">查询</el-button>
			  <el-button class="btn-2">导出</el-button>
      </template>
      <template #table>
        <ztable 
          :isShow='true'
          :tableData='list' 
          :strucs='groupData'
          width="160"
          align="left"
          :height="'100%'"
          :isshowOperation="true"
        >
        <template #default="slotScope">
          <el-button type="text" class="operation" 
            @click="handleImplement(slotScope.rowData)" 
            v-jurisdiction="'customer:access:perform'"
            v-if="slotScope.rowData.status === '待处理'"
            >执行</el-button>
            <el-button type="text" class="operation" 
            @click="handleEditItem(slotScope.rowData)"
            >修改</el-button>
        </template>
        </ztable>
        
      </template>
      <template #page>
        <zpage
            :currentPage="current" 
            :total="total" 
            :pageSize="size"
            @handleSizeChange="handleSizeChange" 
            @handleCurrentChange="handleCurrentChange"
        ></zpage>
      </template>
    </zsearch>



    <!-- 执行 -->
    <!-- <zdialog title="执行随访" @handleClose="closeDialog" v-model="followDialogVisible" :btnData="followDialogBtnData">
      <template #body>
        <div class="flex-wrap">
          <component :is="showWidget(item.type)" v-for="item in followAddData" :key="item.name" :struc="item" :passWidth="50"  />
        </div>
      </template>
  </zdialog> -->
  <!-- 修改随访待处理，已完成 -->
    <zdrawer size="55%" @handleClose="drawer('修改随访')" :title="eidtTitle" v-model="editShowDrawer" >
      <template #body>
        <div class="drawer-main">
          <div class="drawer-info">
            <zswitchtabs :personID="PersonId"></zswitchtabs>
          </div>
          <div class="drawer-opration">
            <div class="drawer-content">
              <!-- 随访计划 -->
              
                <div class="callapse">
                <div class="show-head" @click="handleShow">
                  <span class="head-ctx">
                      <!-- <component :is="showWidget(item.type)"  v-for="item in firstThreeData" :key="item.name" :struc="item"  /> -->
                      <span class="name">{{personName}}</span>
                      <span class="sex">
                        <el-icon v-if="sex === '男'" class="male-color"><male /></el-icon>
                        <el-icon v-if="sex === '女'" class=" female-color"><female /></el-icon>
                      </span>
                      <span>电话 {{mobileNum}}</span>
                  </span>
                  <span class="icon-btn">
                    <el-icon v-if="isShow"><arrow-right /></el-icon>
                    <el-icon v-else><ArrowDown /></el-icon>
                  </span>
                  
                </div>
                <div class="show-content" v-show="!isShow">
                  <!-- 有多条数据展开时 -->
                    
                    <div class="dynamic flexwrap">
                      <component :is="showWidget(item.type)"  v-for="item in registerAdd" :key="item.name" :struc="item"  />
                    </div>
                </div>
                </div>
              <!-- 执行 -->
                <div class="direct-implement">
                  <div class="flex-wrap">
                    <div class="leftToRight-layout">
                        <div class="label">
                          <span>随访医生</span>
                        </div>
                        <div class="operations">
                          <el-select  class="w-180" v-model="doctorId"  placeholder="请选择">
                            <el-option
                              v-for="item in doctorOptions"
                              :key="item.id"
                              :label="item.name"
                              :value="item.id">
                            </el-option>
                          </el-select>
                        </div>
                    </div>
                    <div class="leftToRight-layout">
                      <div class="label">
                        <span>随访人员</span>
                      </div>
                      <div class="operations">
                        <el-select  class="w-180" v-model="dealUserId"  placeholder="请选择">
                          <el-option
                            v-for="item in dealUserOptions"
                            :key="item.id"
                            :label="item.name"
                            :value="item.id">
                          </el-option>
                        </el-select>
                      </div>
                    </div>

                    <div class="leftToRight-layout" v-show='eidtTitle === "修改随访(待计划)"'>
                      <div class="label">
                        <span>咨询师</span>
                      </div>
                      <div class="operations">
                        <el-select v-model="consultantId" class="w-180"  placeholder="请选择">
                            <el-option
                              v-for="item in optionsSecondaryUser"
                              :key="item.id"
                              :label="item.name"
                              :value="item.id">
                            </el-option>
                          </el-select>
                      </div>
                    </div>
                    <div class="leftToRight-layout">
                      <div class="label">
                        <span>{{eidtTitle === '修改随访(已完成)' ? '随访时间':'计划时间'}}</span>
                      </div>
                      <div class="operations">
                        <el-date-picker
                          type="date"
                          v-model="planTime"
                          @change="handleChangeDate"
                          >
                        </el-date-picker>
                      </div>
                    </div>
                    <div class="leftToRight-layout" v-show="eidtTitle === '修改随访(已完成)'">
                      <div class="label">
                        <span>联系方式</span>
                      </div>
                      <div class="operations">
                        <el-select  class="w-180" v-model="contactType"  placeholder="请选择">
                          <el-option
                            v-for="item in contactOptions"
                            :key="item.id"
                            :label="item.name"
                            :value="item.id">
                          </el-option>
                        </el-select>
                      </div>
                    </div>
                    <div class="leftToRight-layout">
                      <div class="label">
                        <span>随访内容</span>
                      </div>
                      <div class="operations">
                        <div>
                          <el-select
                            v-model="planContentType"
                            @change="handleSelectChange($event)" 
                            placeholder="请选择"
                            >
                            <el-option
                              v-for="item in optionList"
                              :key="item.id"
                              :label="item.name"
                              :value="item.id">
                            </el-option>
                          </el-select>
                          <el-input
                            type="textarea"
                            :rows="4"
                            placeholder="请输入内容"
                            v-model="planContent"
                            >
                          </el-input>
                        </div>
                        
                      </div>
                    </div>
                    <div class="leftToRight-layout" v-show="eidtTitle === '修改随访(已完成)'">
                      <div class="label">
                        <span>随访结果</span>
                      </div>
                      <div class="operations">
                        <div>
                          <el-select
                            v-model="backContentType"
                            @change="handleResultChange($event)" 
                            placeholder="请选择"
                            >
                            <el-option
                              v-for="item in optionResultList"
                              :key="item.id"
                              :label="item.name"
                              :value="item.id">
                            </el-option>
                          </el-select>
                          <el-input
                              type="textarea"
                              :rows="4"
                              v-model="backContent"
                              placeholder="随访结果"
                              >
                            </el-input>
                          </div>
                      </div>
                    </div>
                    <div class="leftToRight-layout" style="width: 100%;">
                      <div class="label">
                        <span>备注</span>
                      </div>
                      <div class="operations">
                        <el-input
                            type="textarea"
                            v-model="remark"
                            :rows="6"
                            >
                          </el-input>
                      </div>
                    </div>
                  </div>
                </div>
            </div>
          </div>
        </div>
      </template>
      <template #footer>
        <el-button class="btn-2" @click="drawer(eidtTitle)">取消</el-button>
        <el-button class="btn-1" @click="save(eidtTitle)">保存</el-button>
      </template>
    </zdrawer>

    <!-- 执行随访 -->
    <zdrawer size="55%" @handleClose="drawer('执行随访')" title="执行随访" v-model="showPerformDrawer" >
      <template #body>
        <div class="drawer-main">
          <div class="drawer-info">
            <zswitchtabs :personID="PersonId"></zswitchtabs>
          </div>
          <div class="drawer-opration">
            <div class="drawer-content">
              <!-- 随访计划 -->
                <div class="callapse">
                <div class="show-head" @click="handleShow">
                  <span class="head-ctx">
                      <!-- <component :is="showWidget(item.type)"  v-for="item in firstThreeData" :key="item.name" :struc="item"  /> -->
                      <span class="name">{{personName}}</span>
                      <span class="sex">
                        <el-icon v-if="sex === '男'" class="male-color"><male /></el-icon>
                        <el-icon v-if="sex === '女'" class=" female-color"><female /></el-icon>
                      </span>
                      <span>电话 {{mobileNum}}</span>
                  </span>
                  <span class="icon-btn">
                    <el-icon v-if="isShow"><arrow-right /></el-icon>
                    <el-icon v-else><ArrowDown /></el-icon>
                  </span>
                  
                </div>
                <div class="show-content" v-show="!isShow">
                  <!-- 有多条数据展开时 -->
                    
                    <div class="dynamic flexwrap">
                      <component :is="showWidget(item.type)"  v-for="item in registerAdd" :key="item.name" :struc="item"  />
                    </div>
                </div>
                </div>
              <!-- 执行 -->
                <div class="direct-implement">
                  <div class="flex-wrap">
                    <div class="leftToRight-layout">
                        <div class="label">
                          <span>创建人</span>
                        </div>
                        <div class="operations">
                          <span>{{createUserName || '暂无'}}</span>
                        </div>
                    </div>
                    <div class="leftToRight-layout">
                        <div class="label">
                          <span>创建时间</span>
                        </div>
                        <div class="operations">
                          <span>{{createTime || '暂无'}}</span>
                        </div>
                    </div>
                    <div class="leftToRight-layout">
                        <div class="label">
                          <span>随访医生</span>
                        </div>
                        <div class="operations">
                          <span>{{doctorName || '暂无'}}</span>
                          <!-- <el-select  class="w-180" v-model="doctorId"  placeholder="请选择">
                            <el-option
                              v-for="item in doctorOptions"
                              :key="item.id"
                              :label="item.name"
                              :value="item.id">
                            </el-option>
                          </el-select> -->
                        </div>
                    </div>
                    <div class="leftToRight-layout">
                      <div class="label">
                        <span>随访人员</span>
                      </div>
                      <div class="operations">
                        <span>{{dealUserName || '暂无'}}</span>
                        <!-- <el-select  class="w-180" v-model="dealUserId"  placeholder="请选择">
                          <el-option
                            v-for="item in dealUserOptions"
                            :key="item.id"
                            :label="item.name"
                            :value="item.id">
                          </el-option>
                        </el-select> -->
                      </div>
                    </div>

                    <div class="leftToRight-layout">
                      <div class="label">
                        <span>咨询师</span>
                      </div>
                      <div class="operations">
                        <span>{{consultantName || '暂无'}}</span>
                        <!-- <el-select v-model="consultantId" class="w-180"  placeholder="请选择">
                            <el-option
                              v-for="item in optionsSecondaryUser"
                              :key="item.id"
                              :label="item.name"
                              :value="item.id">
                            </el-option>
                          </el-select> -->
                      </div>
                    </div>
                    <div class="leftToRight-layout">
                      <div class="label">
                        <span>联系方式</span>
                      </div>
                      <div class="operations">
                        <el-select  class="w-180" v-model="contactType"  placeholder="请选择">
                          <el-option
                            v-for="item in contactOptions"
                            :key="item.id"
                            :label="item.name"
                            :value="item.id">
                          </el-option>
                        </el-select>
                      </div>
                    </div>
                    <div class="leftToRight-layout">
                      <div class="label">
                        <span>{{'计划时间'}}</span>
                      </div>
                      <div class="operations">
                        {{planTime}}
                        <!-- <el-date-picker
                          type="date"
                          v-model="planTime"
                          @change="handleChangeDate"
                          >
                        </el-date-picker> -->
                      </div>
                    </div>
                    <div class="leftToRight-layout">
                      <div class="label">
                        <span>随访内容</span>
                      </div>
                      <div class="operations">
                        <span>{{planContent || '暂无'}}</span>
                        <!-- <el-input
                            type="textarea"
                            :rows="4"
                            placeholder="请输入内容"
                            v-model="planContent"
                            >
                          </el-input> -->
                      </div>
                    </div>
                    <div class="leftToRight-layout" >
                      <div class="label">
                        <span>随访结果</span>
                      </div>
                      <div class="operations">
                        <div>
                          <el-select
                            v-model="backContentType"
                            @change="handleResultChange($event)" 
                            placeholder="请选择"
                            >
                            <el-option
                              v-for="item in optionResultList"
                              :key="item.id"
                              :label="item.name"
                              :value="item.id">
                            </el-option>
                          </el-select>
                          <el-input
                            type="textarea"
                            :rows="4"
                            v-model="backContent"
                            placeholder="随访结果"
                            >
                          </el-input>
                        </div>
                        
                      </div>
                    </div>
                    <div class="leftToRight-layout" style="width: 100%;">
                      <div class="label">
                        <span>备注</span>
                      </div>
                      <div class="operations">
                        <el-input
                            type="textarea"
                            v-model="remark"
                            :rows="6"
                            >
                          </el-input>
                      </div>
                    </div>
                  </div>
                </div>
            </div>
          </div>
        </div>
      </template>
      <template #footer>
        <!-- <el-button class="btn-1" @click="revisit">再回访</el-button>
        <el-button class="btn-1" @click="cancelReturnVisit">取消本次回访</el-button> -->
        <el-button class="btn-2" @click="drawer('执行随访')">取消</el-button>
        <el-button class="btn-1" @click="save('执行随访')">保存</el-button>
      </template>
    </zdrawer>

</template>

<script lang='ts'>
import { ArrowDown, ArrowRight, Male, Female } from '@element-plus/icons-vue'
import { defineComponent, reactive, toRefs, ref, onUnmounted } from '@vue/runtime-core'
import ztable from '@components/Table/index.vue'
import zpage from '@components/pagination/pagination.vue'
import zsearch from '@components/search/search.vue'
import zdialog from '@components/dialog/dialog.vue'
import useConfgin from '../../hook/getconfig'
import useShowWidget from "../../components/widget/usechoose";
import useDataCheck, { DataStruc } from "./../../hook/datastruc";
import { debounce } from "../../utils/debounce"

import zdrawer from "../../components/drawer/drawer.vue"
import zswitchtabs from '../../components/switchTabs/switchTabs.vue'

import { getAllUser, getConsultant, getAccessLogContactType, getAccessFollowContent, getAccessFollowBackContent } from "./../../usefn/getDoctor"

import {Option} from "../../types"
import { getNowDate } from '../../utils/nowDate'

import { ElMessage, ElMessageBox } from 'element-plus'

import useRequet, { RespData } from "../../hook/network"
import { useRouter } from "vue-router"

// 随访
const configID = 533
const registerID = 523
export default defineComponent({
  name: 'FollowUpManagements',
  components: {
    ztable,
    zpage,
    zsearch,
    zdialog,
    zdrawer,
    zswitchtabs,

    ArrowDown, ArrowRight, Male, Female
  },
  setup() {
    let search = reactive({
      date:'',
      name:'',
      current: 1,
      size: 10,
      total: 0,
      list: [],
      isActive: 'person',
      loading: false
    })
    const router = useRouter()
    const request = useRequet({ path: "" });
    const PersonId = ref<string>()
    const req = () => {
      search.loading = true;
      let params = {
        planDay: search.date,
        size : search.size,
        total: search.total,
        current: search.current
      }
      request.sendRequest({
        address: 'sick/accessLog/getSubCompanyLogPage',
        params: params || {},
        success: (resp: RespData) => {
          if(resp.code !== 0) return ElMessage.error(resp.msg || '获取全部患者失败')
					search.list = resp.data.records
          search.total = resp.data.total
          search.current = resp.data.current

          search.loading = false;
        },
        fail: (resp: RespData) => {
          if(resp.code !== 0) return ElMessage.error(resp.msg || '获取全部患者失败')
          search.loading = false;
        },
        method: "POST",
      })
    }
    req()

    const debounceRefresh = debounce(req, 1000)
    const hanledSearch = () => {
      console.debug('搜索')
      debounceRefresh()
    }
     // 分页
    const handleCurrentChange = (val: number) => {
			search.current = val
      req()
			console.debug('handleCurrentChange', val)
		}
    const handleSizeChange = (val: number) => {
      search.size = val
      req()
			console.debug('handleSizeChange', val)
		}

    const handleSelectChange = (v: string) => {
        drawerData.planContent = v
    }

    const handleResultChange = (v: string) => {
      drawerData.backContent = v
    }

    const rowList = useConfgin(configID)
    const groupData = rowList.groupDataList.value;

    const showWidget = useShowWidget;
    const dataCheck = useDataCheck();
    
    //  抽屉
    const drawerData = reactive({
      eidtTitle: '修改随访(已完成)',
      editShowDrawer: false,
      showPerformDrawer: false,

      doctorId: null,
      dealUserId: null,
      consultantId: null,
      planTime: '',
      contactType: '',
      planContent: '',
      planContentType: '',
      backContent: '',
      backContentType: '',
      remark: '',
      doctorOptions:[] as Option[],
      optionsSecondaryUser: [] as Option[],
      dealUserOptions: [] as Option[],
      contactOptions: [] as Option[],
      optionList: [] as Option[],
      optionResultList: [] as Option[],

      createUserName: '',
      createTime: '',
      doctorName: '',
      dealUserName: '',
      consultantName: '',
    })

    // 得到所有用户 / 咨询师 / 联系方式
    const getDealUserOptions = async() => {
      try{
        drawerData.dealUserOptions = await getAllUser()
        drawerData.optionsSecondaryUser = await getConsultant()
        drawerData.contactOptions = await getAccessLogContactType()
        drawerData.optionList = await getAccessFollowContent()
        drawerData.optionResultList = await getAccessFollowBackContent()
      } catch(e) {
        throw e
      }
      
    }
    getDealUserOptions()

    const drawer = (type: string) => {
      ElMessageBox.confirm('此操作将关闭窗口, 是否继续?', '提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning',
      }).then(() => {
        
        if(type === '执行随访') {
          drawerData.showPerformDrawer = false
        }
        drawerData.editShowDrawer = false
			}).catch(() => {
					ElMessage({
						type: 'info',
						message: '已取消',
					});
      })
      
      
    }

    const isShow = ref(false)
    const sex = ref('')
    const mobileNum = ref('')
    const personName = ref('')
    const followId = ref()

    const registerinfo = useConfgin(registerID)
    const registerAdd = registerinfo.groupDataAdd

    const handleShow = () => {
      console.log('点击了')
      isShow.value = !isShow.value
    }

    const handleChangeDate = (e: Date, index = -1) => {
        drawerData.planTime = getNowDate(e)
    }

    // 获取患者信息
    const getPersonInfo = (id: number) => {
      request.sendRequest({
        address: `customer/info/getCustomerInfo/${id}`,
        params: {},
        success: (resp: RespData) => {
          if(resp.code !== 0) return ElMessage.error(resp.msg || '获取信息失败')
          let list = resp.data
          sex.value = list.gender
          personName.value = list.name
          mobileNum.value = list.mobileNum
          registerAdd.value.forEach(item => {
            item.value = list[item.name]
          })
        },
        fail: (resp: RespData) => {
          if(resp.code !== 0) return ElMessage.error(resp.msg)
          
        },
        method: "GET",
      })
    }

    const getDoctorAndNurse = () => {
      // 获取医生
      request.sendRequest({
        address: 'company/user/user/getDoctorUserByStatus',
        params: {
          name: ''
        },
        success: (resp: RespData) => {
          if(resp.code !== 0) return ElMessage.error(resp.msg || '获取信息失败')
          console.log(resp.data)
          drawerData.doctorOptions = resp.data
        },
        fail: (resp: RespData) => {
          if(resp.code !== 0) return ElMessage.error(resp.msg)
          
        },
        method: "POST",
      }) 
    }

    // 修改随访回显数据
    const eidtEchoData = (id: number) => {
      request.sendRequest({
        address: `sick/accessLog/getAccessLogById/${id}`,
        params: {},
        success: (resp: RespData) => {
          if(resp.code !== 0) return ElMessage.error(resp.msg || '获取信息失败')
          console.log('修改', resp.data)
          let data = resp.data
          drawerData.doctorId = data.doctorId
          drawerData.dealUserId = data.dealUserId
          drawerData.consultantId = data.consultantId
          drawerData.planTime = data.planTime
          drawerData.planContent = data.planContent
          drawerData.remark = data.remark
          drawerData.contactType = data.contactType
          drawerData.backContent = data.backContent

          drawerData.createUserName = data.createUserName
          drawerData.createTime = data.createTime
          drawerData.doctorName = data.doctorName
          drawerData.dealUserName = data.dealUserName
          drawerData.consultantName = data.consultantName
        },
        fail: (resp: RespData) => {
          if(resp.code !== 0) return ElMessage.error(resp.msg)
          
        },
        method: "GET",
      }) 
    }

      // 重置计划
    const resetPlan = () => {
      drawerData.doctorId = null,
      drawerData.dealUserId = null,
      drawerData.consultantId = null,
      drawerData.planTime = '',
      drawerData.planContent = '',
      drawerData.planContentType = '',
      drawerData.remark = '',
      drawerData.contactType = '',
      drawerData.backContent = '',
      drawerData.backContentType = '',

      // 执行随访展示
      drawerData.createUserName = '',
      drawerData.createTime = '',
      drawerData.doctorName = '',
      drawerData.dealUserName = '',
      drawerData.consultantName = ''
    }

    // 执行
    const handleImplement = (rowData: any) => {
      let { id, customerId } = rowData
      PersonId.value = String(customerId)
      followId.value = rowData.id
      getPersonInfo(customerId)
      eidtEchoData(id)
      drawerData.showPerformDrawer = true
    }
    // 修改(完成、待计划)
    const handleEditItem = (rowData: any) => {
      let { id, customerId } = rowData
      PersonId.value = String(customerId)
      followId.value = id
      getPersonInfo(customerId)
      eidtEchoData(id)
      getDoctorAndNurse()
      console.log(rowData.status)
      if(rowData.status === '待处理') {
        drawerData.eidtTitle = '修改随访(待计划)'
      }
      if(rowData.status === '完成') {
        drawerData.eidtTitle = '修改随访(已完成)'
      }
      drawerData.editShowDrawer = true
    }

    // 保存
    const save = (type: string) => {
      if(type === '执行随访') {

        handleFollow()
      }

      console.log(type)
      if(type === '修改随访(已完成)') {
        
        eidtOver()
      }

      if(type === '修改随访(待计划)') {
        eidtHandle()
      }
    } 

      // 修改随访(已完成) 
    const eidtOver = () => {
      request.sendRequest({
          address: 'sick/accessLog/updateCompleteFollowAccessLog',
          params: {
            id: followId.value,
            doctorId: drawerData.doctorId,
            dealUserId: drawerData.dealUserId,
            planTime: drawerData.planTime,
            planContent: drawerData.planContent,
            remark: drawerData.remark,
            contactType: drawerData.contactType,
            backContent: drawerData.backContent
          },
          success: (resp: RespData) => {
            if(resp.code !== 0) return ElMessage.error(resp.msg || '获取信息失败')
            console.log(resp.data)
            ElMessage.success('修改随访成功')
            resetPlan()
            req()
            drawerData.editShowDrawer = false
          },
          fail: (resp: RespData) => {
            if(resp.code !== 0) return ElMessage.error(resp.msg)
            
          },
          method: "POST",
        })
    }

    // 修改随访(待处理) 未完成
    const eidtHandle = () => {
      request.sendRequest({
          address: 'sick/accessLog/updateCompleteFollowAccessPlan',
          params: {
            id: followId.value,
            doctorId: drawerData.doctorId,
            dealUserId: drawerData.dealUserId,
            consultantId: drawerData.consultantId,
            planTime: drawerData.planTime,
            planContent: drawerData.planContent,
            remark: drawerData.remark,
          },
          success: (resp: RespData) => {
            if(resp.code !== 0) return ElMessage.error(resp.msg || '获取信息失败')
            console.log(resp.data)
            ElMessage.success('修改随访成功')
            resetPlan()
            req()
            drawerData.editShowDrawer = false
          },
          fail: (resp: RespData) => {
            if(resp.code !== 0) return ElMessage.error(resp.msg)
            
          },
          method: "POST",
        })
    }
    
    
    // 执行随访
    const handleFollow = () => {
      request.sendRequest({
        address: 'sick/accessLog/completeAccessLog',
        params: {
          id: followId.value,
          backContent: drawerData.backContent,
          remark: drawerData.remark,
          contactType: drawerData.contactType,
        },
        success: (resp: RespData) => {
          if(resp.code !== 0) return ElMessage.error('执行随访' + resp.msg)
          ElMessage.success('执行随访成功')
          drawerData.showPerformDrawer = false
          resetPlan()
          req()
        },
        fail: (resp: RespData) => {
          if(resp.code !== 0) return ElMessage.error('执行随访' + resp.msg)
        },
        method: "POST",
      })
    }

  

    onUnmounted(() => {
			dataCheck.clearDataCheck();
		});
    return {
      PersonId,
      groupData,  
      ...toRefs(search), 
      hanledSearch,
      handleCurrentChange,
      handleSizeChange,
      close,
      handleSelectChange,
      handleResultChange,

      screen,
      // getPerson,
      // getSeeDoctor,
      ...toRefs(drawerData),
      drawer,
      handleShow,
      showWidget,
      handleChangeDate,
      isShow,
      followId,
      sex,
      personName,
      mobileNum,
      registerinfo,
      registerAdd,
      handleImplement,
      handleEditItem,
      save,
    }
  }
})
</script>

<style lang="scss" scoped>
@import '../../style/followrtyle.scss';
</style>